package org.whuims.pois.model;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by 声伟 on 2014/5/18 0018.
 */
@Entity
@Table(name = "clickedrecord")
public class Clickedrecord {
    private long id;
    private String titlelink;
    private Timestamp clicktime;
    private String ip;
    private String referer;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "titlelink", nullable = true, insertable = true, updatable = true, length = 255)
    public String getTitlelink() {
        return titlelink;
    }

    public void setTitlelink(String titlelink) {
        this.titlelink = titlelink;
    }

    @Basic
    @Column(name = "clicktime", nullable = false, insertable = true, updatable = true)
    public Timestamp getClicktime() {
        return clicktime;
    }

    public void setClicktime(Timestamp clicktime) {
        this.clicktime = clicktime;
    }

    @Basic
    @Column(name = "ip", nullable = true, insertable = true, updatable = true, length = 255)
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Basic
    @Column(name = "referer", nullable = true, insertable = true, updatable = true, length = 255)
    public String getReferer() {
        return referer;
    }

    public void setReferer(String referer) {
        this.referer = referer;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Clickedrecord that = (Clickedrecord) o;

        if (id != that.id) return false;
        if (clicktime != null ? !clicktime.equals(that.clicktime) : that.clicktime != null) return false;
        if (ip != null ? !ip.equals(that.ip) : that.ip != null) return false;
        if (referer != null ? !referer.equals(that.referer) : that.referer != null) return false;
        if (titlelink != null ? !titlelink.equals(that.titlelink) : that.titlelink != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + (titlelink != null ? titlelink.hashCode() : 0);
        result = 31 * result + (clicktime != null ? clicktime.hashCode() : 0);
        result = 31 * result + (ip != null ? ip.hashCode() : 0);
        result = 31 * result + (referer != null ? referer.hashCode() : 0);
        return result;
    }
}
